<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
          background: url(./images/desktop_1.jpg) no-repeat top center/cover;
        }
      </style>
</head>

<body>
    <script>
    
        // 要求：每次刷新，随机显示背景图片，图片范围desktop_1.jpg~desktop_10.jpg
        // console.log(document.body)
        const body =document.body

        // 取到 N ~ M 的随机整数
        function random(N,M){
            return Math.floor(Math.random()* (M-N+1)+N)

        }
        // 随机数
        const num =random(1,10)
        // 修改body的背景样式
        body.style.background = url(./images/desktop_${num}.jpg)
    
    
    
    
    
    
    
    
    
    
    
      </script>
</body>
</html>